x86: avoid LOCK prefix in some cases where it's not necessary.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 10 Dec 2007 11:55:55 +0000 (11:55 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 10 Dec 2007 11:55:55 +0000 (11:55 +0000)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vlapic.c
xen/arch/x86/traps.c
xen/common/page_alloc.c

index 0fbbd12d9ec0f70c50aab57b665325ccb4b9c754..854e58040e794837a7ef12c01bda1ad6def67537 100644 (file)
@@ -81,7 +81,7 @@ void hvm_enable(struct hvm_function_table *fns)
      * delays, but the vmexits simply slow things down).
      */
     memset(hvm_io_bitmap, ~0, sizeof(hvm_io_bitmap));
-    clear_bit(0x80, hvm_io_bitmap);
+    __clear_bit(0x80, hvm_io_bitmap);
 
     hvm_funcs   = *fns;
     hvm_enabled = 1;
index 3d27d4684035136754dc627881f83c0b85b5db5e..5ac455b1fe15a140918d1885726be3f78b75e0a4 100644 (file)
@@ -408,7 +408,7 @@ static void vlapic_ipi(struct vlapic *vlapic)
         if ( vlapic_match_dest(v, vlapic, short_hand, dest, dest_mode) )
         {
             if ( delivery_mode == APIC_DM_LOWEST )
-                set_bit(v->vcpu_id, &lpr_map);
+                __set_bit(v->vcpu_id, &lpr_map);
             else
                 vlapic_accept_irq(v, delivery_mode,
                                   vector, level, trig_mode);
index 80d989733bc4da86f8cb4a25d385b5075e3ea088..9cc1669116deb74c941615d4f96fee2f45491635 100644 (file)
@@ -677,25 +677,25 @@ static int emulate_forced_invalid_op(struct cpu_user_regs *regs)
     if ( regs->eax == 1 )
     {
         /* Modify Feature Information. */
-        clear_bit(X86_FEATURE_VME, &d);
-        clear_bit(X86_FEATURE_PSE, &d);
-        clear_bit(X86_FEATURE_PGE, &d);
+        __clear_bit(X86_FEATURE_VME, &d);
+        __clear_bit(X86_FEATURE_PSE, &d);
+        __clear_bit(X86_FEATURE_PGE, &d);
         if ( !cpu_has_sep )
-            clear_bit(X86_FEATURE_SEP, &d);
+            __clear_bit(X86_FEATURE_SEP, &d);
 #ifdef __i386__
         if ( !supervisor_mode_kernel )
-            clear_bit(X86_FEATURE_SEP, &d);
+            __clear_bit(X86_FEATURE_SEP, &d);
 #endif
         if ( !IS_PRIV(current->domain) )
-            clear_bit(X86_FEATURE_MTRR, &d);
+            __clear_bit(X86_FEATURE_MTRR, &d);
     }
     else if ( regs->eax == 0x80000001 )
     {
         /* Modify Feature Information. */
 #ifdef __i386__
-        clear_bit(X86_FEATURE_SYSCALL % 32, &d);
+        __clear_bit(X86_FEATURE_SYSCALL % 32, &d);
 #endif
-        clear_bit(X86_FEATURE_RDTSCP % 32, &d);
+        __clear_bit(X86_FEATURE_RDTSCP % 32, &d);
     }
     else
     {
index 4c723e5d27326c28fd73d3bc1f490746ee43b11e..2d5f3f6da3b931d287b0a5f59579bfdf9f516c9e 100644 (file)
@@ -301,14 +301,15 @@ static void init_node_heap(int node)
     /* First node to be discovered has its heap metadata statically alloced. */
     static heap_by_zone_and_order_t _heap_static;
     static unsigned long avail_static[NR_ZONES];
-    static unsigned long first_node_initialised;
+    static int first_node_initialised;
 
     int i, j;
 
-    if ( !test_and_set_bit(0, &first_node_initialised) )
+    if ( !first_node_initialised )
     {
         _heap[node] = &_heap_static;
         avail[node] = avail_static;
+        first_node_initialised = 1;
     }
     else
     {